# Maintainer: Sarah Ottinger <schalaalexiazeal@gmail.com>

_realname=godot_headers
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=3.2
pkgrel=2
pkgdesc='Headers for the Godot API supplied by the GDNative module. (mingw-w64)'
arch=('any')
url="http://www.godotengine.org/"
license=('MIT')
_commit='4b73c5445ef544a7a59de0836c08cbc0c9a62846'
source=("https://github.com/godotengine/godot_headers/archive/${_commit}.tar.gz")
sha256sums=('e7a98d148bbcb5a0c94ad85f0b2b8f575808636faeac63543c4de20a518811c2')

prepare() {
  rm -r "${_realname}-${pkgver}" | true
  mv "godot_headers-${_commit}" "${_realname}-${pkgver}"
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"

  mkdir -p "${pkgdir}${MINGW_PREFIX}/include"
  find . -type f -name '*.h' -exec install -Dm644 {} "${pkgdir}${MINGW_PREFIX}/include/godot/"{} \;
  install -D -m644 LICENSE.md "${pkgdir}${MINGW_PREFIX}/share/licenses/godot_headers/LICENSE.md"
  install -D -m644 api.json "${pkgdir}${MINGW_PREFIX}/share/godot/api.json"
}
